package com.oracle.service.impl;

import java.util.List;

import com.oracle.dao.CarDao;
import com.oracle.service.CarService;
import com.oracle.dao.impl.carDaoImpl;


public class CarServiceImpl implements CarService {

	CarDao carDao = new carDaoImpl();

    @Override
    public List<Object> getCarList() {
        String sql = "select * from cardata";
        return carDao.query(sql, null);
    }

    @Override
    public int insertCar(Object[] params) {
        String sql ="insert into cardata(name) values(?)";
        return carDao.update(sql, params);
    }

    @Override
    public int modifyCar(Object[] params) {
        String sql ="update cardata set name = ? where id = ?";
        return carDao.update(sql, params);
    }

    @Override
    public int deleteCar(Object[] params) {
        String sql ="delete from cardata where id = ?";
        return carDao.update(sql, params);
    }

}
